import request from '../utils/request.ts'
import {type TransferRecord} from '../model/transfer_record';
import type {PageInfo} from "plus-pro-components";

/**
 * 获取微信转账记录列表
 * @param params - 分页和筛选参数
 * @returns 转账记录列表和总条数
 */
export const getWXTransferRecords =async  (params: Partial<PageInfo> & TransferRecord) => {
    let res = await request.get<any>('/wx/transfer-records', {
        params,
    });
    return res.data.data;
};

/**
 * 新增微信转账记录
 * @param data - 转账记录数据
 * @returns 新增的记录ID
 */
export const createWXTransfer = async (data: Omit<TransferRecord, 'transaction_id'>) => {
    let res = await request.post<number>('/wx/transfer', data);
    return res.data;
};

// 其他接口...